<div class="col-md-2">
<%= render partial: "search/nav" , locals: { section: "search-tags" } %>
</div>

<div class="col-md-10">
  <div class="container">
    <% if params[:query].blank?%>
      <%= render partial: "search/form", locals: { searchType: "tags/" } %>
      <p>Please enter a search term.</p>

    <% elsif @tags.present? %>
      <h2>Search tags</h2>
      <div class="container">
        <h2> Results for <%= @search_criteria.query %></h2>
        <p> <strong> Searched notes that contain the tag</strong></p>
        <hr>

        <div class="row">
          <%= render partial: "tag/topicCard" %>
        </div>
      </div>
      <div class="text-center">
        <% if @pagy %>
          <%= raw  pagy_bootstrap_nav @pagy %>
        <% else %>
          <%= will_paginate @tags, renderer: WillPaginate::ActionView::BootstrapLinkRenderer unless @unpaginated %></div>
        <% end %>
      </div>
    <% else %>
     <p>No results found for "<b><%= params[:query] %></b>" :-(</p>
     <p>Try searching for another topic or looking for our items tagged with <a href="/tag/<%= params[:query] %>"><%= params[:query] %></a>
    <% end %>
  </div>
</div>

